<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="STYLESHEET" type="text/css" href="../lps/includes/styles.css" /></head>
<body>

<!-- ===================================================================== -->
<!-- = XML information goes here                                         = -->
<!-- ===================================================================== -->
<lzelement title="LzResizeReplicationManager">
    <lztier>LFC</lztier>
    <lzcategory>Data</lzcategory>
    <lzshortdesc>
        An optimization for displaying large sets of data that allows the elements to resize.
    </lzshortdesc>
    <lzapi>api-lzresizereplicationmanager.xml</lzapi>
</lzelement>
<p>
The <classname>LzResizeReplicationManager</classname> extends the capabilities of the <classname>LzLazyReplicationManager</classname> so that the elements in the replication can be resized in their axis. All of the restrictions on the use of the <classname>LzLazyReplicationManager</classname> apply to the <classname>LzResizeReplicationManager</classname> except for this one:
</p>
<ul>
    <li>The replicated view <em>can</em> change its size in the replication axis, and the size <em>can</em> be a constraint. Resize replication should work in all cases -- even those in which the replicated view is sized by its contents.</li>
</ul>
<p>
Note that the performance of a resize replication manager is related to the number of items displayed and the length of the data, whereas the lazy replication manager performance is only determined by the number of items displayed.
</p>
<example class="program" id="lzresizereplicationmanager-1">
&lt;canvas height="200"&gt;
    &lt;dataset name="vegetables"&gt;
        &lt;celery/&gt; &lt;celeriac/&gt; &lt;carrot/&gt; &lt;florence_fennel/&gt; &lt;parsnip/&gt; 
        &lt;parsley/&gt; &lt;winter_endive/&gt; &lt;witloof_chicory/&gt; &lt;cardoon/&gt; 
        &lt;artichoke/&gt; &lt;head_lettuce/&gt; &lt;cos_lettuce/&gt; &lt;black_salsify/&gt; 
        &lt;swedish_turnip/&gt; &lt;cauliflower/&gt; &lt;cabbage/&gt; &lt;brussels_sprouts/&gt; 
        &lt;kohlrabi/&gt; &lt;broccoli/&gt; &lt;savoy_cabbage/&gt; &lt;turnip/&gt; &lt;radish/&gt; 
        &lt;water_cress/&gt; &lt;garden_cress/&gt; &lt;foliage_beet/&gt; &lt;spinach/&gt; 
        &lt;sweet_potato/&gt; &lt;watermelon/&gt; &lt;melon/&gt; &lt;cucumber/&gt; &lt;winter_squash/&gt; 
        &lt;marrow/&gt; &lt;chickpea/&gt; &lt;lentil/&gt; &lt;runner_bean/&gt; &lt;common_bean/&gt; 
        &lt;pea/&gt; &lt;faba_bean/&gt; &lt;leek/&gt; &lt;shallot/&gt; &lt;onion/&gt; &lt;salsify/&gt; 
        &lt;welsh_onion/&gt; &lt;garlic/&gt; &lt;chives/&gt; &lt;asparagus/&gt; &lt;ladyfinger/&gt; 
        &lt;sweet_corn/&gt; &lt;rhubarb/&gt; &lt;capsicum_pepper/&gt; &lt;tomato/&gt; &lt;eggplant/&gt;
    &lt;/dataset&gt;

    &lt;simplelayout spacing="10" /&gt;
    &lt;text width="200" oninit="checkSubviews()"&gt;
        &lt;method name="checkSubviews"
                event="onaddsubview" reference="replicationParent"&gt;
            this.setText( 'number of subviews: ' + 
                          replicationParent.subviews.length );
        &lt;/method&gt;
    &lt;/text&gt;

    &lt;view <span class="redText">clip="true"</span> width="100" height="160" id="clipper"&gt;
        &lt;<span class="redText">view id="replicationParent"</span>&gt;
            &lt;view bgcolor="#CCCCFF" height="15"&gt;
                &lt;datapath xpath="vegetables:/*/name()" <span class="redText">spacing="5" replication="resize"</span>/&gt;
                &lt;text datapath="name()" valign="middle"/&gt;
                &lt;method name="toggleSize" event="onclick"&gt;
                    if ( this.height != 40 ){
                        this.animate ( 'height', 40 , 500 );
                    } else {
                        this.animate ( 'height', 15 , 500 );
                    }
                &lt;/method&gt;
                &lt;/view&gt;
        &lt;/view&gt;
        &lt;scrollbar/&gt;
    &lt;/view&gt;

&lt;/canvas&gt;
</example>
<p class="smaller">Using a resize replication manager to display a large datasetwhen the elements resize.</p>
</body>
</html>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
